﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenIddict.Client;

namespace SageKing.OpenIddict.Client;

public class OpenIddictClientToken(OpenIddictClientService service) : IOpenIddictToken
{ 
    public async Task<string> GetTokenWithClientCredentialsAsync()
    {
        var result = await service.AuthenticateWithClientCredentialsAsync(new());
        return result.AccessToken;
    }
}
